feat: add fire + executions subgroup (parity with @cueapi/mcp 0.4.0)#24
Conversation
Brings the CLI to parity with the @cueapi/mcp 0.3.0 + 0.4.0 surface for
the fire-cue and worker-execution-lifecycle operations.
New top-level command:
- cueapi fire <cue-id> [--payload-override JSON] [--merge-strategy merge|replace]
Wraps POST /v1/cues/{id}/fire. For ad-hoc one-shot triggers and for
using cues as a messaging channel between agents.
New executions subgroup with seven subcommands:
- executions list
- executions list-claimable [--task] [--agent] server-side SQL filter
- executions get <id>
- executions claim <id> --worker-id ID
- executions claim-next --worker-id ID [--task] internal fan-out when --task
- executions heartbeat <id> --worker-id ID X-Worker-Id header transport
- executions report-outcome <id> --success/--failure [--external-id ...]
Notes:
- list-claimable uses server-side query params for the task / agent filter,
not client-side. Client-side filter after fetch hits the LIMIT 50
starvation bug fixed in the 2026-04-25 prod incident (see app/routers/
executions.py:122-131 docstring in cueapi-core).
- claim-next with --task fans out via list-claimable + claim by ID since
the server's POST /v1/executions/claim endpoint does not accept a task
filter today. Tiny race window between list and claim is bounded by the
atomic claim returning 409, in which case the caller retries.
- heartbeat sends worker_id via the X-Worker-Id request header, not body.
--worker-id is required even though the server permits omission, so
misconfigured callers fail at the CLI instead of silently bypassing the
race-protection check.
Version: 0.1.5 -> 0.2.0. Aligned cueapi/__init__.py (had drifted to 0.1.3)
with pyproject.toml at the same time.
Tests: 36 pass (was 19, +17 new help-text + arg-parsing tests for the new
commands following the existing pattern).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mikemolinet
left a comment
There was a problem hiding this comment.
Cue-Pm reviewed and approved.
|
Diff LGTM — clean parity work mirroring What's strong here
On the Only real blocker One small framing note (nit, ship anyway) 🤖 Reviewed by Claude Code — comment only, awaiting human approval to merge. |
Same change as the (now-closed) fork PR #23. Re-opened from an upstream branch so CI workflows can access secrets and auto-merge can fire.
Summary
Brings cueapi-cli to parity with @cueapi/mcp 0.3.0 + 0.4.0 surface for fire-cue and worker-execution-lifecycle operations.
What's added
One top-level command:
cueapi fire <cue-id> [--payload-override JSON] [--merge-strategy merge|replace]One new subgroup with seven commands:
cueapi executions listhistorical executionscueapi executions list-claimable [--task] [--agent]server-side SQL filtercueapi executions get <id>single-row fetchcueapi executions claim <id> --worker-id IDatomic claimcueapi executions claim-next --worker-id ID [--task]internal fan-out when --taskcueapi executions heartbeat <id> --worker-id IDX-Worker-Id header transportcueapi executions report-outcome <id> --success/--failure [...]write-once outcomeNotable design choices
Tests
pytest tests/36 pass (was 19, +17 new help-text + arg-parsing tests). No live API calls.Version
0.1.5 -> 0.2.0. Aligned cueapi/init.py (had drifted to 0.1.3) with pyproject.toml at the same time.